 import Vue from "vue"
 import router from "../router"
 import store from "../store"
 export default{
     mustBeLogin(){
        let token = localStorage.getItem("token");
      if (!token) {
        Vue.prototype.$toast("请先登录!");
        setTimeout(() => {
            // isGoBack改成true
            // 调用muations中的IsGoBack方法，传一个参数true
            console.log(store);
        store["_mutations"]["isGoBack/chanisgoBack"][0](true)
        console.log(store["_mutations"]["isGoBack/chanisgoBack"][0]);
        router.push("/user");
        }, 1000);

        return false;
      }
      return true
     }
 }
 